#ifndef EXPERIMENTALJOINTEST_H_JM_20130205
#define EXPERIMENTALJOINTEST_H_JM_20130205

#include "../boxes/TesterSharedOutputBoxImpl.h"
#include "../../models/ExperimantalModel.h"


namespace jm4bbx {

	template<int parallelismLevel>
	class ExperimentalJoinTester : 
		public TesterSharedOutputBoxImplSql, public ModelTest {
	public:
		virtual std::string getTestName() const override {
			return std::string("ExpJoinTester[") + 
				jmlib::convert<std::string>(parallelismLevel) + "]";
		}

		virtual std::string getDataSpecification() const override { 
			return "SELECT * FROM data_2 INNER JOIN data_3 ON data_2.c1 = data_3.c1"; 
		};

		virtual size_t getSharedOutputCount() const override {
			return parallelismLevel;
		}

		virtual std::string getModel() override {
			// Zaregistrovanie boxu do runtimu.
			static std::string outputBoxName = 
				std::string("ExpJoinTesterOUT_") 
				+ jmlib::convert<std::string>(parallelismLevel);
			typedef ExperimentalJoinTester<parallelismLevel> ImplType;
			registerBox<ImplType>(outputBoxName.c_str());
			// Konfiguracia generatoru modelu.

			InputBoxConfiguration first = {"SELECT@*@FROM@data_2", 0};
			InputBoxConfiguration second = {"SELECT@*@FROM@data_3", 0};

			ExperimentalModel amg(getSharedOutputCount(), 
				"SQL_BOX", first, second, "EXPERIMENTAL_JOIN",
				outputBoxName.c_str(), "both", "IntegerKeyRecord", true);

			return amg.generateModel();
		}
	};

} // namespace jm4bbx

#endif
